<template>
	<view class="cardCont">
		<view v-for="(item, index) in list" :key="index" class="box_item mb3 flex" @click="tzDetail(item)">
			<image class="logoImg" :src="item.logo?item.logo:imgHost+'/default_changguan.jpg'"></image>
			<view class="cont">
				<view class="f30 fwb c3">{{item.venueName}}</view>
				<view v-if="showList.indexOf('1') > -1" class="f26 c6 mt10">营业时间：{{item.openTimeStart}} ~ {{item.openTimeEnd}}</view>
				<view v-if="showList.indexOf('2') > -1 && item.projectName" class="f26 c6 mt10">经营项目：{{item.projectName}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			},
			showList: {
				type: Array,
				default: ()=>['1','2']
			},
		},
		methods: {
			jump(url, params, a) {
				this.$app.jump(url, params, a);
			},
			jump2(url, params, a) {
				this.$app.jump2(url, params, a);
			},
			formatSeconds(e) {
			   return this.$app.formatSeconds(e);
			},
			//单张图片预览
			previewImg(imgurl) {
				let _this = this;
				let imgsArray = [];
				imgsArray[0] = imgurl
				uni.previewImage({
					current: 0,
					urls: imgsArray
				});
			},
			tzDetail(item) {
				this.$store.commit('setVenueName', item.name || item.venueName);
				this.$store.commit('setVenueId', item.venueId);
				this.jump2('/pages/venue/indexShop?id=', item.venueId)
			}
		}

	}
</script>
<style lang="scss" scoped>
	.cardCont {
		.box_item {
			width: 100%;
			background: #FFFFFF;
			border-radius: 8rpx;
			position: relative;
			overflow: hidden;
			box-sizing: border-box;
			padding: 20rpx;
			.logoImg {
				width: 120rpx;
				margin-right: 20rpx;
				height: 120rpx;
				border-radius: 16rpx;
				overflow: hidden;
			}
		}
	}
</style>